//
//  MyTextField.m
//  Qihuo
//
//  Created by Vencoo on 13-10-18.
//  Copyright (c) 2013年 Vencoo. All rights reserved.
//

#import "MyTextField.h"

@implementation MyTextField

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}
- (CGRect)textRectForBounds:(CGRect)bounds
{
    UILabel *label = [UILabel new];
    label.text = @"自定义";
    label.font = [UIFont systemFontOfSize:32];
    CGSize mySize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    CGRect newRect = CGRectMake(0 ,(bounds.size.height - mySize.height)/2 ,bounds.size.width,mySize.height);
    return newRect;
}
- (CGRect)editingRectForBounds:(CGRect)bounds{
    UILabel *label = [UILabel new];
    label.text = @"自定义";
    label.font = [UIFont systemFontOfSize:32];
    CGSize mySize = [label.text sizeWithFont:label.font constrainedToSize:CGSizeMake(MAXFLOAT, 40)];
    CGRect newRect = CGRectMake(0 ,(bounds.size.height - mySize.height)/2 ,bounds.size.width,mySize.height);
    return newRect;
}



@end
